<script type="text/javascript"> 
$(document).ready(function(){

    $.formValidator.initConfig({
        formid:"form_edit",
        validatorgroup:"4",
        autotip:true
    });


    $("#reciver").formValidator({
        validatorgroup:"4",
        empty:false,
        tipid:'notetip',
        onshow:"请输入接收人的名字",
        onfocus:"请输入接收人的名字",
        oncorrect:" "
    }).inputValidator({
        min:1,onerror:"接收人不能为空,请确认"
    });


    $("#phoneno").formValidator({
        validatorgroup:"4",
        empty:false,
        tipid:'notetip',
        onshow:"请输入手机号",
        onfocus:"请输入手机号",
        oncorrect:" "
    }).inputValidator({
        min:1,onerror:"手机不能为空,请确认"
    });


    $("#address").formValidator({
        validatorgroup:"4",
        empty:false,
        tipid:'notetip',
        onshow:"请输入收货人地址",
        onfocus:"请输入收货人地址",
        oncorrect:" "
    }).inputValidator({
        min:1,onerror:"收货人不能为空,请确认"
    });


    $("#memo").formValidator({
        validatorgroup:"4",
        empty:false,
        tipid:'notetip',
        onshow:"请输入相关的说明",
        onfocus:"请输入相关的说明",
        oncorrect:" "
    });


    $("#postcode").formValidator({
        validatorgroup:"4",
        empty:false,
        tipid:'notetip',
        onshow:"请输入邮政编码",
        onfocus:"请输入邮政编码",
        oncorrect:" "
    }).inputValidator({
        min:1,onerror:"邮政编码不能为空,请确认"
    });

    $("#update_address").click(function(){
        var pass=$.formValidator.pageIsValid('4');
        if(pass){
            var queryString = $('#form_edit').formSerialize();
            //alert(queryString);
            $.post(APP+"/Member/mb_address_update", queryString,function(msg){
                if(msg=='0'){ //先保留msg这个值以备以后使用
                    showtips('编辑信息成功!','tips',1);
                    mbsimajax(APP+"/Member/ajax_address/","ajax_list");//刷新
                    removeDialogbox("#mb_address_edit");
                }else{
                    showtips(msg,'tips',2);
                }
            });
        }
    });


});



</script> 

<div class="userAddress clearfix">
    <form id="form_edit"> 
    <div class="inputWrap fl">
        <label for="userRealName">收货人:</label>
        <input id="reciver" name="reciver" type="text" class="input" style="width:74px;"  value="{$data.reciver}" />
    </div>

    <div class="inputWrap fl">
        <label for="userPhoneNumber">手机或电话:</label>
        <input id="phoneno" name="phoneno" type="text" class="input" style="width:100px;" value="{$data.phoneno}" />
    </div>
    
    <div class="inputWrap fl">
        <label for="zipCode">邮编:</label>
        <input id="postcode" name="postcode" type="text" class="input" value="{$data.postcode}" style=" width:50px;" title="邮编" />
    </div>

    <div class="inputWrap fl cl">
        <label for="detailedAddress">收货地址:</label>
        <div class="clearfix">
            <textarea id="address" name="address" class="input textarea" style="width:191px; height:50px;"  title="详细街道门牌" >{$data.address}</textarea>
        </div>
    </div>
    <div class="inputWrap fl">
        <label for="remarks">备注:</label>
        <div class="clearfix">
            <textarea id="memo" name="memo" class="input textarea" style="width:220px; height:50px;" title="如果您有什么补充，请备注说明">{$data.memo}</textarea>
        </div>
    </div>
    
    <input type="hidden" name="id" id="id" value="{$data.id}" />
    
    <div class="cb">
        <span class="button">
            <span class="first-child">
                <button type="button" class="f12" id='update_address'>确认编辑</button>
            </span>
        </span>
        
        <span id="notetip"></span>
        <span id="tips"></span> 
    </div>

</form>
</div>